/**
 * @description: 认证信息工具类
 * @Author: huangpeng
 * @Date: 2023年05月14日 18:51
 * @Copyright:  2022-2023
 */
import Cookies from 'js-cookie';

const TokenKey = 'User-Token';

const ExpiresInKey = 'User-Expires-In';

const UsernameKey = 'username';

const UserIdKey = 'userId';

const UserThirdBindStatusKey = 'User-Third-BindS-Status';

export function getToken() {
  return Cookies.get(TokenKey) || '';
}

export function setToken(token: string) {
  return Cookies.set(TokenKey, token);
}

export function removeToken() {
  return Cookies.remove(TokenKey);
}

export function getExpiresIn() {
  return Cookies.get(ExpiresInKey) || -1;
}

export function setExpiresIn(time: any) {
  return Cookies.set(ExpiresInKey, time);
}

export function removeExpiresIn() {
  return Cookies.remove(ExpiresInKey);
}

export function getUsername() {
  return Cookies.get(UsernameKey) || '';
}

export function setUsername(username: any) {
  return Cookies.set(UsernameKey, username);
}

export function removeUsername() {
  return Cookies.remove(UsernameKey);
}

export function setUserId(id: any) {
  return Cookies.set(UserIdKey, id);
}

export function removeUserId() {
  return Cookies.remove(UserIdKey);
}

export function getUserId() {
  return Cookies.get(UserIdKey) || '';
}
